const Controller = require('egg').Controller;

class UsersController extends Controller {
  async login() {
    const { ctx, app } = this;
    const data = await ctx.service.users.login()
    ctx.body = data;
  }

  async identity() {
    const { ctx } = this;
    if (ctx.state.user.userid === 0) {
      ctx.body = {
        code: 0, feUrl: [
          {
            path: '/',
            text: ''
          }
        ]
      }
    } else {
      ctx.body = {
        code: 0, feUrl: [
          {
            path: '/',
            text: ''
          }
        ]
      }
    }
  }
}

module.exports = UsersController;